extern _printf
SECTION .data
const1: dq 5.3
a: dd 0
b: dq 0.0
igual: dd 0
intFormat: db "%d", 10, 0
doubleFormat: db "%.2f", 10, 0
SECTION .text
global _WinMain@16
_fatorialNaoRecursivo:
push ebp
mov ebp, esp
sub esp, 4
push dword 1
pop dword [ebp-4]
push dword [ebp+8]
push dword 0
pop ebx
pop eax
cmp eax, ebx
jle fatorialNaoRecursivo_else_1_block
fatorialNaoRecursivo_while_1_begin:
push dword 1
push dword 1
pop ebx
pop eax
cmp eax, ebx
jne fatorialNaoRecursivo_while_1_end
push dword [ebp-4]
push dword [ebp+8]
pop ebx
pop eax
imul eax, ebx
push eax
pop dword [ebp-4]
push dword [ebp+8]
push dword 1
pop ebx
pop eax
sub eax, ebx
push eax
pop dword [ebp+8]
push dword [ebp+8]
push dword 0
pop ebx
pop eax
cmp eax, ebx
jne fatorialNaoRecursivo_else_2_block
jmp fatorialNaoRecursivo_while_1_end
jmp fatorialNaoRecursivo_endif_2
fatorialNaoRecursivo_else_2_block:
fatorialNaoRecursivo_endif_2:
jmp fatorialNaoRecursivo_while_1_begin
fatorialNaoRecursivo_while_1_end:
push dword [ebp-4]
pop eax
mov esp, ebp
pop ebp
ret
jmp fatorialNaoRecursivo_endif_1
fatorialNaoRecursivo_else_1_block:
push dword 0
pop eax
mov esp, ebp
pop ebp
ret
fatorialNaoRecursivo_endif_1:
mov esp, ebp
pop ebp
ret
_fatorialRecursivo:
push ebp
mov ebp, esp
sub esp, 4
push dword [ebp+8]
push dword 0
pop ebx
pop eax
cmp eax, ebx
jle fatorialRecursivo_else_1_block
fatorialRecursivo_while_1_begin:
push dword 1
push dword 1
pop ebx
pop eax
cmp eax, ebx
jne fatorialRecursivo_while_1_end
push dword [ebp+8]
push dword 1
pop ebx
pop eax
sub eax, ebx
push eax
pop dword [ebp+8]
push dword [ebp+8]
push dword 2
pop ebx
pop eax
cmp eax, ebx
jne fatorialRecursivo_else_2_block
push dword [ebp+8]
pop eax
mov esp, ebp
pop ebp
ret
jmp fatorialRecursivo_endif_2
fatorialRecursivo_else_2_block:
fatorialRecursivo_endif_2:
jmp fatorialRecursivo_while_1_begin
fatorialRecursivo_while_1_end:
jmp fatorialRecursivo_endif_1
fatorialRecursivo_else_1_block:
push dword 0
pop eax
mov esp, ebp
pop ebp
ret
fatorialRecursivo_endif_1:
mov esp, ebp
pop ebp
ret
_WinMain@16:
push ebp
mov ebp, esp
sub esp, 20
fld qword [const1]
fstp qword [ebp-20]
fld qword [ebp-20]
fstp qword [b]
fld qword [b]
fld qword [ebp-20]
faddp st1
fstp qword [b]
push dword 5
pop dword [a]
push dword [a]
call _fatorialNaoRecursivo
add esp, 4
push eax
pop dword [ebp-12]
push dword [a]
call _fatorialRecursivo
add esp, 4
push eax
pop dword [ebp-8]
push dword 6
pop dword [ebp-4]
push dword [ebp-4]
push dword 0
pop ebx
pop eax
cmp eax, ebx
jle WinMain@16_else_1_block
WinMain@16_while_1_begin:
push dword 1
push dword 1
pop ebx
pop eax
cmp eax, ebx
jne WinMain@16_while_1_end
push dword [ebp-4]
push dword 1
pop ebx
pop eax
sub eax, ebx
push eax
pop dword [ebp-4]
push dword [ebp-4]
push dword intFormat
call _printf
add esp, 8
push dword [ebp-4]
push dword 0
pop ebx
pop eax
cmp eax, ebx
jne WinMain@16_else_2_block
jmp WinMain@16_while_1_end
jmp WinMain@16_endif_2
WinMain@16_else_2_block:
WinMain@16_endif_2:
jmp WinMain@16_while_1_begin
WinMain@16_while_1_end:
jmp WinMain@16_endif_1
WinMain@16_else_1_block:
WinMain@16_endif_1:
mov esp, ebp
pop ebp
mov eax, 0
ret
